package com.rtx.wms.std.qm.service;

import com.qimen.api.DefaultQimenClient;
import com.qimen.api.QimenClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

public class QimenService {

    protected Logger logger = LoggerFactory.getLogger(this.getClass());

//    @Value("${qimen.api.serverurl:http://qimen.api.taobao.com/top/router/qmtest}")
    @Value("${qimen.api.serverurl:http://qimen.api.taobao.com/router/qimen/service}")
    protected String serverurl;
    
    @Value("${qimen.api.serverurl:http://qimen.api.taobao.com/top/router/qmtest}")
    protected String testServerurl;

    @Value("${qimen.api.appkey:28428678}")
    protected String appkey;

    @Value("${qimen.api.appsecret:e398a1b5ffdd176041306916f18d820d}")
    protected String appsecret;

    protected QimenClient getQimenClient(){
        return new DefaultQimenClient(serverurl,appkey,appsecret);
    }
    
    protected QimenClient getTestQimenClient(){
    	return new DefaultQimenClient(testServerurl,appkey,appsecret);
    }
}
